package spotGUI.ElementViewer;

import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;

import spotGUI.GUIElements.MarkerGUI.VoteDisplay;
import elements.Vote;

public class VoteView extends JPanel {
	private JButton btnCommentsender;
	private VoteDisplay voteDisplay;
	private Component horizontalGlue;

	
	public VoteView(Vote vote) {
		
		setPreferredSize(new Dimension(367, 34));
		setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
		
		btnCommentsender = new JButton(vote.senderName);
		btnCommentsender.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
		btnCommentsender.setFont(new Font("Dialog", Font.BOLD, 12));
		btnCommentsender.setContentAreaFilled(false);
		btnCommentsender.setBorderPainted(false);
		add(btnCommentsender);
		
		horizontalGlue = Box.createHorizontalGlue();
		add(horizontalGlue);
		
		voteDisplay = new VoteDisplay(vote.vote);
		add(voteDisplay);
	}

}
